package com.mpyy.pojo;

import lombok.*;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @version 1.0
 * @Descrioption CurrentAccountingCustomers
 * @Author QIAO
 * @Date 2022-03-13 21:02
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class CurrentAccountingCustomers {
    private String ccustName;

    private String ccustTypeName;

    private Date csalOrdDate;

    private String csalOrdId;

    private Double csalOrdReceivable;

    private Double csalOrdPaidIn;

    private String cempName;

    private String ccustPhone;

    private String ccustAddress;

    private String csalOrdComment;


    private Date salOrdDate;

    //分页参数
    private Integer page;

    private Integer limit;

    public void setPage(Integer page){
        this.page = ( page - 1 ) * this.limit;
    }

    //搜索，开始日期
    private Date currentTimeStart;
    //搜索，结束日期
    private Date currentTimeEnd;

    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");

    public void setSalOrdDate(String salOrdDate){
        try {
            this.salOrdDate = simpleDateFormat.parse(salOrdDate);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }

    public void setCurrentTimeStart(String currentTimeStart){
        try {
            this.currentTimeStart = simpleDateFormat.parse(currentTimeStart);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }

    public void setCurrentTimeEnd(String currentTimeEnd){
        try {
            this.currentTimeEnd = simpleDateFormat.parse(currentTimeEnd);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}